package com.example.signin

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.util.Log
import com.example.signin.databinding.ActivityLoginBinding
import com.example.signin.uitl.HttpUtil
import java.io.IOException


class LoginActivity: Activity() {
    private lateinit var binding: ActivityLoginBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityLoginBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.login.setOnClickListener { login() }
        binding.user1.setHintTextAppearance(R.style.hintStyle)
        binding.pwd1.setHintTextAppearance(R.style.hintStyle)
    }

    private fun login() {
        startActivity(Intent(this@LoginActivity, MainActivity::class.java))

//        Log.d("TAG", "login: ===========================")
//        HttpUtil.httpGet("http://192.168.1.6:5000/login",HashMap<String,String>().apply {
//            put("username","admin")
//            put("password","admin")
//        },object :HttpUtil.CallBack{
//            override fun success(result: HttpUtil.Result?) {
////                Log.d("TAG", "success: ${result?.content}")
//            }
//
//            override fun failed(e: IOException?) {
//                e?.printStackTrace()
//            }
//
//        })
    }
}